package ${package}.${moduleName}.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;
import ${package}.${moduleName}.domain.entity.${ClassName}Entity;
import ${package}.${moduleName}.domain.vo.${ClassName}VO;
import ${package}.${moduleName}.domain.form.${ClassName}Form;

/**
* ${tableComment}
*
* @author ${author}
* @datetime ${datetime}
*/
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ${converterClassName}Converter {
    /**
     * 单例
     */
    ${converterClassName}Converter INSTANCE = Mappers.getMapper(${converterClassName}Converter.class);

    /**
     * VO 转 实体
     * @param vo VO
     * @return 实体
     */
    ${ClassName}Entity vo2Entity(${ClassName}VO vo);

    /**
     * 实体 转 VO
     * @param entity 实体
     * @return VO
     */
    ${ClassName}VO entity2VO(${ClassName}Entity entity);

    /**
     * 表单转实体
     * @param form 表单
     * @param entity 实体
     */
    void form2Entity(${ClassName}Form form, @MappingTarget ${ClassName}Entity entity);

    /**
     * 表单转实体
     * @param form 表单
     * @return 实体
     */
    ${ClassName}Entity form2Entity(${ClassName}Form form);

    /**
     * 实体分页数据转 VO 分页数据
     * @param entityPage 实体分页
     * @return VO 分页
     */
    Page<${ClassName}VO> entity2VO(Page<${ClassName}Entity> entityPage);

}